<?php

Class authenticate {
//Delcaring a public variable with a default property
  public $db = 'EventDB';
  public $utable = 'SysUser';

//Delaring a public method
  public function AuthMe($uname,$pword){
   $pword=sha1($pword);
   if ($uname != "") { 
    $sql="Select password from ".$this->utable." where username = '".$uname."'";
    $dbConn=odbc_connect($this->db,'MyUser','Temp123');
    $rs_pw=odbc_exec($dbConn,$sql);
    if (odbc_result($rs_pw,"password")==sha1($pword)) { //if it is a hash value then ==sha1($pword))
      return (True);
    }
    else {
      return (False);
    };
    odbc_close($dbConn);
   };
  }
}
?>
